<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>设备信息</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script type="text/javascript">
  //编写自定义JS代码
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="deviceTypeController.do?doUpdate" tiptype="3" >
		<input id="id" name="id" type="hidden" value="${obj.id }">
		<table style=" " cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
					<label class="Validform_label">
						编号:
					</label>
					</td>
					<td class="value">
				     	 <input id="no" name="no" type="text" style="width: 150px"
				     	  class="inputxt"  datatype="*" onkeypress="specialTextValidate()" maxlength="100" value="${obj.no }">
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">编号</label>
					</td>		
						
					<td align="right">
						<label class="Validform_label">
							设备名称:
						</label>
					</td>
					<td class="value">
					     	 <input id="name" name="name" type="text" style="width: 150px"
					     	  class="inputxt"  datatype="*" onkeypress="specialTextValidate()" maxlength="100" value="${obj.name }">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">设备名称</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							实验室:
						</label>
					</td>
					<td class="value"> 
                	     <input id="labId" name="labId" type="hidden" value="${obj.lab.id }">               
					     <input id="labName"  type="text" style="width: 150px" class="inputxt" readonly="readonly" datatype="*" value="${obj.lab.name }">
					     <t:choose textname="name" inputTextname="labName" hiddenName="labId" hiddenid="id" url="labController.do?goSelect" name="labList"
                          icon="icon-search" title="选择实验室"  isclear="false" isInit="true" width="470px"></t:choose>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">实验室</label>						
					</td>
					<td align="right">
						<label class="Validform_label">
							设备所属项目:
						</label>
					</td>
					<td class="value"> 
                	     <input id="itemId" name="itemId" type="hidden"  value="${obj.teachItem.id }">               
					     <input id="itemName"  type="text" style="width: 150px" class="inputxt" readonly="readonly" datatype="*" value="${obj.teachItem.itemName }">
					     
					     <t:choose textname="itemName" inputTextname="itemName" hiddenid="id" hiddenName="itemId"  url="dictTeachItemController.do?goSelect" name="groupList"
                          icon="icon-search" title="选择实验室"  isclear="false" isInit="true" width="470px"></t:choose>
					     
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">设备所属项目</label>						
					</td>
				</tr>	
				<tr>
					<td align="right">
						<label class="Validform_label">
							数量:
						</label>
					</td>
					<td class="value">
					     	 <input id="balance" name="balance" type="text" style="width: 150px" 
					     	 class="inputxt" onkeypress="specialTextValidate()" maxlength="100" datatype='n' maxlength="30" value="${obj.balance}">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">数量</label>
					</td>
					<td align="right">
						<label class="Validform_label">
							单位:
						</label>
					</td>
					<td class="value">
					     	 <input id="unit" name="unit" type="text" style="width: 150px" class="inputxt"  maxlength="50" value="${obj.unit }">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">单位</label>
					</td>
				</tr>
					<tr>
					<td align="right">
						<label class="Validform_label">
							图片:
						</label>
					</td> 
					<td class="value" colspan="3">
		         		
		         		<c:forEach items="${attList}" var="att">
		         			<div class="prevImg" id="prevImg${att.id}" data-id="${att.id }">
		         				<img src="cms-attach.do?get&attachId=${att.id }" style="height:80px;width:80px">
		         				<a onclick='deleteAttach(${att.id})'>删&nbsp;除</a>
		         			</div>  	 
		         		</c:forEach> 
		         		
		         		 <div id="wrapper">
					        <div id="container">
					            <div id="uploader">
					                <div class="queueList">
					                    <div id="dndArea" class="placeholder">
					                        <div id="filePicker"></div>
					                        <p>请选择图片文件，不能超过5M</p>
					                    </div>
					                </div>
					                <div class="statusBar" style="display:none;">
					                    <div class="progress">
					                        <span class="text">0%</span>
					                        <span class="percentage"></span>
					                    </div><div class="info"></div>
					                    <div class="btns">
					                        <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
					                    </div>
					                </div>
					            </div>
					        </div>
   						</div>
		           </td> 
			  </tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							状态:
						</label>
					</td>
					<td class="value">
							  <t:enumSelect field="stateValue" type="radio"
									  defaultVal="${obj.state.value}" 
									  hasLabel="false"  enumClass="com.mengtian_tech.smart_lab.entity.device.DeviceState"
									  title="状态"></t:enumSelect>     
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">状态</label>
					</td>
					<td align="right">
						<label class="Validform_label">
							所属管理员:
						</label>
					</td>
					<td class="value">
						<input id="teacherId" name="teacherId" type="hidden" value="${obj.holder.id }">               
					     <input id="teacherName"  type="text" style="width: 150px" class="inputxt" readonly="readonly" datatype="*" value="${obj.holder.realName }">
					     
					     <t:choose textname="realName" inputTextname="teacherName" hiddenid="id" hiddenName="teacherId"  url="teacherController.do?goSelect" name="teacherList"
                          icon="icon-search" title="选择实验室"  isclear="false" isInit="true" width="470px"></t:choose>
					     
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">所属管理员</label>	
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							存放位置:
						</label>
					</td>
					<td class="value"> 
							<input id="location" name="location" type="text" style="width: 150px" 
					     	 class="inputxt" onkeypress="specialTextValidate()" maxlength="100" value="${obj.location}">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">位置</label>
					</td>
				
					<td align="right">
						<label class="Validform_label">
							资金来源:
						</label>
					</td>
					<td class="value">
					     	 <input id="moneyFrom" name="moneyFrom" type="text" 
					     	 style="width: 150px" class="inputxt" maxlength="100" value="${obj.moneyFrom}">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">资金来源</label>
					</td> 
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							用途:
						</label>
					</td>
					<td class="value">
					    <input id="useDesc" name="useDesc" type="text" style="width: 150px" class="inputxt" maxlength="100" value="${obj.useDesc}">
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">用途</label>
					</td> 
				
					<td align="right">
						<label class="Validform_label">
							供应商名称:
						</label>
					</td>
					<td class="value">
					     	 <input id="provider" name="provider" type="text" style="width: 150px" class="inputxt" value="${obj.provider}">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">供应商名称</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							联系电话:
						</label>
					</td>
					<td class="value">
					     	 <input id="phone" name="phone" type="text" style="width: 150px" class="inputxt" maxlength="100" value="${obj.phone}">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">联系电话</label>
					</td>
				
					<td align="right">
						<label class="Validform_label">
							服务人员名称:
						</label>
					</td>
					<td class="value" colspan="3">
					     	 <input id="server" name="server" type="text" style="width: 150px" class="inputxt" maxlength="100" value="${obj.server}">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">服务人员名称</label>
						</td>
				</tr>
												<tr>
					<td align="right">
						<label class="Validform_label">
							货架号:
						</label>
					</td>
					<td class="value">
					     	 <input id="shelvesNo" name="shelvesNo" type="text" style="width: 150px" class="inputxt" maxlength="100">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">货架号</label>
					</td>
				
					<td align="right">
						<label class="Validform_label">
							型号:
						</label>
					</td>
					<td class="value">
						<input id="model" name="model" type="text" class="inputxt" value="${obj.model}"/>  
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">型号</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							价格:
						</label>
					</td>
					<td class="value">
						<input id="price" name="price" type="text" onkeyup="this.value=this.value.match(/^\d*\.?\d{0,2}/)[0]" value='${obj.price }'
						class="inputxt"> 
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">价格</label>
					</td>
					
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							维修信息:
						</label>
					</td>
					<td class="value" colspan="4">
						  	 <textarea style="width:300px;height:100px;" class="inputxt" rows="6" id="remark" name="remark" maxlength="200">${obj.remark}</textarea>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">备注</label>
					</td>
				</tr>
			</table>
		</t:formvalid>
		
		<!-- 上传文件  -->
    <link rel="stylesheet" type="text/css" href="plug-in/webUploader/css/webuploader.css" />
    <link rel="stylesheet" type="text/css" href="plug-in/webUploader/style.css" />
    <script type="text/javascript" src="plug-in/webUploader/dist/webuploader.js"></script>
     <script type="text/javascript" src="plug-in/webUploader/third/uploadImg.js"></script>
     	<script>
			
			 $(document).ready(function () { 
				$('#filePicker2').hide();  
			});
			
			function  uploaderReady(){
				window.uploader.options.fileNumLimit =1;
			}
			 
			function deleteAttach(id){
				 $('#prevImg'+id).remove();
				 $('#formobj').append("<input type='hidden' name='deletedAttach'  value='"+id+"'/>");
			}
		 
		</script>  
 </body>